﻿<%namespace name="include" file="/admin/base/include.html" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>无标题文档</title>
${include.jquery()}
${include.bootstrap()}
${include.validationEngine()}
${include.ueditor()}
</head>
<body>
<form id="dataform" class="well form-horizontal" method="post" action="${request.url}" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="30" background="/static/admin/images/tab/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="/static/admin/images/tab/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="46%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="/static/admin/images/tab/tb.gif" width="16" height="16" /></div></td>
                <td width="95%" class="STYLE1">
                    <span class="STYLE3">你当前的位置</span>：[${request.params['menu1']}]-[${request.params['menu2']}]-[${id==None and u'新增' or u'编辑'}]
                </td>
              </tr>
            </table></td>
          </tr>
        </table></td>
        <td width="16"><img src="/static/admin/images/tab/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td width="370"></td>
                <td width="370"></td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="3">
                    <div class="control-group">
                        <label class="control-label">商品名</label>
                        <div class="controls">
                            <input name="name" type="text" id="name" value="${product and product.name or ''}" class="input-medium validate[required, maxSize[200]]"/>
                        </div>
                    </div>
                </td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td>
                    <div class="control-group">
                        <label class="control-label">市场价</label>
                        <div class="controls">
                            <input name="marketprice" type="text" class="input-small validate[required, custom[number]], min[0.1]" value="${product and product.marketprice or '0'}"/>
                        </div>
                    </div>
                </td>
                <td>
                    <div class="control-group">
                        <label class="control-label" for="name">优惠价</label>
                        <div class="controls">
                            <input name="sellprice" type="text" class="input-small validate[required, custom[number]], min[0.1]" value="${product and product.sellprice or '0'}"/>
                        </div>
                    </div>
                </td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="name">图片</label>
                        <div class="controls">
                            <input name="picture" type="file"/>
                            <span class="help-block">请上传260*180大小的图片</span>
                            %if product and product.picture:
                            <span class="help-block"><img src="${product.picture}" class="img-polaroid"/></span>
                            %endif
                        </div>
                    </div>
                </td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="3">
                    <div class="control-group">
                        <label class="control-label">简介</label>
                        <div class="controls">
                            <textarea name="shortdetail" rows="3" class="input-area validate[required]">${product and product.shortdetail or ''}</textarea>
                        </div>
                    </div>
                </td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="name">详细</label>
                        <div class="controls">
                            <textarea id="detail" name="detail" class="validate[required]">${product and product.detail or ''}</textarea>
                            <script type="text/javascript">
                                var editor_a = new baidu.editor.ui.Editor({
                                        initialContent:'',
                                        minFrameHeight:150,
                                        });
                                editor_a.render('detail');
                            </script>
                        </div>
                    </div>
                </td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td>
                    <div class="control-group">
                        <label class="control-label">状态</label>
                        <div class="controls">
                            <label class="checkbox">
                                <input name="enable" type="checkbox" ${product and not product.enable and '' or 'checked="checked"'|n}/>
                                激活 
                            </label>
                            <label class="checkbox">
                                <input name="recommended" type="checkbox" ${product and product.recommended and 'checked=checked' or ''}/>
                                推荐 
                            </label>
                        </div>
                    </div>
                </td>
                <td>
                </td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="2">
                    <div class="control-group">
                        <label class="control-label" for="name">分类</label>
                        <div class="controls">
                            <select name="category_id" class="input-medium validate[required]">
                                <option value="">--请选择--</option>
                                %if product:
                                ${h.get_table_options('ProductCategory', 'id', 'name', str(product.category_id))|n}
                                %else:
                                ${h.get_table_options('ProductCategory', 'id', 'name')|n}
                                %endif
                            </select>
                        </div>
                    </div>
                </td>
                <td></td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
            <tr>
                <td width="8" background="/static/admin/images/tab/tab_12.gif">&nbsp;</td>
                <td colspan="3">
                    <div class="form-actions">
                        %if id:
                        <input type="hidden" name="id" value="${id}"/>
                        %endif
                        <input type="hidden" name="form.submitted" value="save"/>
                        <button class="btn btn-primary" type="submit">保存</button>
                        <button class="btn btn-primary" type="reset">重置</button>
                        <button class="btn btn-primary">返回</button>
                    </div>
                </td>
                <td width="8" background="/static/admin/images/tab/tab_15.gif">&nbsp;</td>
            </tr>
        </table>
    </td>
  </tr>
  <tr>
    <td height="35" background="/static/admin/images/tab/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="/static/admin/images/tab/tab_18.gif" width="12" height="35" /></td>
        <td>
        </td>
        <td width="16"><img src="/static/admin/images/tab/tab_20.gif" width="16" height="35" /></td>
    </tr>
</table>
</td>
  </tr>
</table>
</form>
<script>
$(document).ready(function(){
    $('#dataform').validationEngine();
})
</script>
</body>
</html>
